@echo on
rem =============================================================================
rem COPYRIGHT(C) MAXSI SOFTWARE, JONAS 'SORTIE' TERMANSEN 2010

rem This file is part of Maxsi Compile.

rem Maxsi Compile is free software: you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.

rem Maxsi Compile is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rem GNU Lesser General Public License for more details.

rem You should have received a copy of the GNU General Public License
rem along with Maxsi Compile. If not, see <http://www.gnu.org/licenses/>.

rem If you modify this file, please enter your name below and provide contact
rem information in MaxsiCompileContributors.txt. For more information please see
rem MaxsiCompileContributors.bat.
	
rem Contributors to this file:

rem - Jonas 'Sortie' Termansen
rem - [your name here]

rem Maxsi Compile
rem A simply yet powerful system to compile maps for mods

rem MaxsiCompileMap.bat
rem Does the actual compiling

rem =============================================================================

if %ERRORLEVEL%==1 goto end
title %1%

if %mc_runpreprocessor%==1 "%mc_mdbin%\MaxsiMapSync.exe" "%mc_mapsrc%\%1%"
if %ERRORLEVEL%==1 goto end
if %mc_runvbsp%==1 "%mc_vbsp%" %mc_vbsp_param% -game "%mc_modsdkgameinfodir%" "%mc_mapsrc%\%1%"
if %ERRORLEVEL%==1 goto end
if %mc_runvvis%==1 "%mc_vvis%" %mc_vbsp_param% -game "%mc_modsdkgameinfodir%" "%mc_mapsrc%\%1%"
if %ERRORLEVEL%==1 goto end
if %mc_runvrad%==1 "%mc_vrad%" %mc_vbsp_param% -hdr -game "%mc_modsdkgameinfodir%" "%mc_mapsrc%\%1%"
if %ERRORLEVEL%==1 goto end
if %mc_copytomapfolder%==1 del "%mc_game%\%mc_maps%\%1%.bsp"
set mc_copysrc=%mc_mapsrc%\%1%.bsp
set mc_copydest=%mc_game%\%mc_maps%\%1%.bsp
if %mc_copytomapfolder%==1 copy "%mc_copysrc%" "%mc_copydest%"

:end
if %mc_StopBatchCompileIfAnyMapFails%==0 exit /B 0